package top.kaoshanji.p2ch15b;

/**
 * 代码清单-p2ch15b-456页a：表示比赛运动员的类
 * author kaoshanji
 * ^_^
 * create time 2025/2/24 17:11
 */
public class RacerThread extends Thread {

    private RacerFireFlag fireFlag;

    public RacerThread(RacerFireFlag fireFlag) {
        this.fireFlag = fireFlag;
    }

    @Override
    public void run() {
        try {
            this.fireFlag.waitForFire();
            System.out.println("start run " + Thread.currentThread().getName());
        } catch (InterruptedException e) {
            /// ////
        }
    }
}
